﻿#ifndef MODELTEST_H
#define MODELTEST_H

#include <QAbstractListModel>
#include <QStringList>
#include <QObject>
class Data
{
public:
    Data(const QString &type, const QString &size);

    QString type() const;
    QString size() const;

private:
    QString m_type;
    QString m_size;
};

class ModelTest:public QAbstractListModel{
    Q_OBJECT
public:
    explicit ModelTest(QObject *parent=0);
    int rowCount(const QModelIndex &parent) const;
    QVariant data(const QModelIndex &index, int role) const;
    Q_INVOKABLE void insert(int index, const Data &data);
    Q_INVOKABLE void append(const Data &data);
    Q_INVOKABLE void remove(int index);
    Q_INVOKABLE void append(const QVariantMap map);
    Q_INVOKABLE void show(void);
};

#endif // MODELTEST_H
